package com.springboot.demo.entity;

import java.text.SimpleDateFormat;
import java.util.Date;

import lombok.Data;
import lombok.ToString;

@Data
// 不打印id
// @ToString(exclude = "id", callSuper = true, includeFieldNames = true)
public class Person2 {
	
	private int id;
    
    private String name;
    
    private String sex1;
    
    private boolean local;
    
    private Date birthday;
    
    public String getBirthdayStr() {
        if (birthday == null) {
            return null;
        }
        return new SimpleDateFormat("yyyy-MM-dd").format(birthday);
    }
    
	@Override
	public String toString() {
		return "Person [id=" + id + ", name=" + name + ", sex1=" + sex1 + ", local=" + local + ", birthday=" + getBirthdayStr()
				+ "]";
	}
    
}
